package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: happyiu
 * Date: 2021-11-27
 * Time: 16:18
 */

class Animal implements Cloneable {
    private String name;
    @Override
    public Animal clone() {
        Animal o = null;
        try {
            o = (Animal) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return o;
    }
}


public class TestDemo {
    public static void main(String[] args) {
        Animal animal = new Animal();
        Animal animal2 = animal.clone();
        System.out.println(animal == animal2);
    }
}
